<?php

namespace App\Repositories;

use App\Exceptions\BasicException;
use Illuminate\Support\Facades\Hash;
use function Matrix\add;    //引入hash

class GameJackpotPlanDetailRepository {

    /*
     * 新增奖池方案详情
     * @param $param
     * @return bool
     * @throws BasicException
     *
     * */
    public function addNewPlanDetail($param) {
        $addNewPlanDetail = app('model_game_jackpot_plan_detail')->insert($param);
        if ($addNewPlanDetail) return $addNewPlanDetail;
        throw new BasicException(93080);
    }

    /*
     * 查询奖池方案详情
     * @param $plan_id
     * @return bool
     * @throws BasicException
     *
     * */
    public  function  getPlanDetailList($plan_id){
        $getPlanDetailList = app('model_game_jackpot_plan_detail')->select('id','gift_id','number','ratio')->where('plan_id',$plan_id)->with('gift')->get()->toArray();
        return $getPlanDetailList;
    }

}


?>